from mnemoply._renewed_lib.crud import CRUDController, TableCol
import mnemoply._renewed_model.references as dic
from mnemoply._renewed_utils import find_class
 
class SmallDictionaryController(CRUDController):
    def __init__(self, controller_name, lookup_columns=None, model_object=None, view_name=None):
        self.controller_name = controller_name
        if not self.model_object:
            self.model_object = model_object or find_class(controller_name)
        if not self.mysql_view_name:
            self.mysql_view_name = view_name or self.model_object.sqlmeta.table
        if not self.lookup_columns:
            self.lookup_columns=lookup_columns or [TableCol(name='name',caption=_("Name"))]
        CRUDController.__init__(self)


exposed_list = [SmallDictionaryController("StudentType",),
                SmallDictionaryController("PriceFor"),
                SmallDictionaryController("AuditObjectClass_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("PartnerType",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("DocumentType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='min_hours',caption=_("Minimum hours")),
                                                          TableCol(name='min_works',caption=_("Minimum works")),
                                                          TableCol(name='comment',caption=_("Comment"))],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Qualification_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Specialization_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Position_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("PhoneCode_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='value',caption=_("Value")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("CashRegister_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='office',caption=_("Office")),
                                                          TableCol(name='organization',caption=_("Organization")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("CashRegisterDepartmentName_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("ServiceType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("CouponType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='nominal',caption=_("Nominal")),
                                                          TableCol(name='year',caption=_("Year")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Faculty_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='abbr',caption=_("Letter")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("PaymentType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='abbr',caption=_("Letter")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("TestType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Trend_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='one_char',caption=_("Letter")),
                                                          TableCol(name='comment',caption=_("Comment")),
                                                          TableCol(name='payment_type',caption=_("Payment type")),
                                                          TableCol(name='faculty',caption=_("Faculty")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("DischargeReason_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("MarkType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='bad_mark',caption=_("Bad mark?")),
                                                          TableCol(name='hide_mark',caption=_("Hide mark?")),
                                                          TableCol(name='comment',caption=_("Comment")),
                                                          TableCol(name='name_ms',caption=_("MS IT name")),
                                                          TableCol(name='name_rus',caption=_("Name (russian)")),
                                                          TableCol(name='name_ms_rus',caption=_("MS IT name (russian)")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("BusynessType",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("ClassroomType",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Organization",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),
                                                          TableCol(name='full_name',caption=_("Full name")),
                                                          TableCol(name='address',caption=_("Address")),
                                                          TableCol(name='code_ocato',caption=_("OCATO")),
                                                          TableCol(name='code_ocpo',caption=_("OCPO")),
                                                          TableCol(name='code_inn',caption=_("INN")),
                                                          TableCol(name='code_kpp',caption=_("KPP")),
                                                          TableCol(name='director_name',caption=_("Director name")),
                                                          TableCol(name='regalia',caption=_("Regalia")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("AgreementType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("CertificateType_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("TestName_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='plan',caption=_("Plan")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Office_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='ordinal',caption=_("Ordinal")),
                                                          TableCol(name='adress',caption=_("Adress")),
                                                          TableCol(name='comment',caption=_("Comment")),
                                                          TableCol(name='abbreviation',caption=_("Abbreviation")),
                                                          TableCol(name='organization',caption=_("Organization")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("Topic_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='responsible_teacher',caption=_("Responsible teacher")),
                                                          TableCol(name='trend',caption=_("Trend")),
                                                          TableCol(name='final_test',caption=_("Final test")),
                                                          TableCol(name='comment',caption=_("Comment")),
                                                          TableCol(name='is_final_work',caption=_("Is final work")),
                                                          TableCol(name='should_be_a_mark',caption=_("Should be a mark")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("FinalWorkTopic_new",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),
                                                          TableCol(name='topic',caption=_("Topic")),
                                                          TableCol(name='comment',caption=_("Comment")),],
                                          model_object=None, view_name=None),
                SmallDictionaryController("CameFrom",
                                          lookup_columns=[TableCol(name='name',caption=_("Name")),],
                                          model_object=None, view_name=None),
                ]

